/*
*用途：图片表
*作者：hwq
*创建日期：2019-01-14 16:50
*/
const Sequelize = require('sequelize')
const sequelize = require('./sequelize')
const ImgCategory = require('./imgcategory')

const Image = sequelize.define('image', {
  id: { type: Sequelize.INTEGER, allowNull: false, autoIncrement: true, primaryKey: true },
  categoryid: { type: Sequelize.INTEGER, references: { model: ImgCategory, key: 'id' } },
  title: { type: Sequelize.STRING },
  desc: { type: Sequelize.STRING(500) },
  addtime: { type: Sequelize.DATE },
  click: { type: Sequelize.INTEGER },
  imgs: { type: Sequelize.STRING }
})

module.exports = Image;